/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package PackageUpdater.Config;

import java.io.*;
import java.util.ArrayList;

/**
 *
 * @author wcss
 */
public class UpdateList {

    private int updateIndex;
    private String updateLogUrl;
    private String updateScriptPath;
    private UpdateFileEntry[] updateFiles = null;

    public static UpdateList load(String path) throws Exception {
        if (new File(path).exists()) {
            return (UpdateList) ObjectToXMLUtil.loadObjectFromXml(path);
        } else {
            return null;
        }
    }

    public static void save(UpdateList entry, String path) throws Exception {
        ObjectToXMLUtil.saveObjectToXml(entry, path);
    }

    /**
     * @return the updateIndex
     */
    public int getUpdateIndex() {
        return updateIndex;
    }

    /**
     * @param updateIndex the updateIndex to set
     */
    public void setUpdateIndex(int updateIndex) {
        this.updateIndex = updateIndex;
    }

    /**
     * @return the updateLogUrl
     */
    public String getUpdateLogUrl() {
        return updateLogUrl;
    }

    /**
     * @param updateLogUrl the updateLogUrl to set
     */
    public void setUpdateLogUrl(String updateLogUrl) {
        this.updateLogUrl = updateLogUrl;
    }

    /**
     * @return the updateScriptPath
     */
    public String getUpdateScriptPath() {
        return updateScriptPath;
    }

    /**
     * @param updateScriptPath the updateScriptPath to set
     */
    public void setUpdateScriptPath(String updateScriptPath) {
        this.updateScriptPath = updateScriptPath;
    }

    /**
     * @return the updateFiles
     */
    public UpdateFileEntry[] getUpdateFiles() {
        return updateFiles;
    }

    /**
     * @param updateFiles the updateFiles to set
     */
    public void setUpdateFiles(UpdateFileEntry[] updateFiles) {
        this.updateFiles = updateFiles;
    }
}
